package com.sky.controller.user;

import com.sky.pojo.Category;
import com.sky.result.Result;
import com.sky.service.user.UserCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("user/category")
@Api(tags = "c端-分类相关接口")
@Slf4j
@RequiredArgsConstructor
public class UserCategoryController {
    private final UserCategoryService userCategoryService;

    @GetMapping("/list")
    @ApiOperation("查询分类")
    public Result<List<Category>> findList(){
        List<Category> list = userCategoryService.findList();
        return Result.success(list);
    }
}
